--
-- Author: Millson Zhou
-- Date: 2014-07-03 20:57:00
--
local LevelListScene = class("LevelListScene", function()
    return display.newScene("LevelListScene")
end)

local function on_clicked(tag)
    display.replaceScene(require('app.scenes.MenuScene').new(), "fade", 0.6, display.COLOR_WHITE)
end

function LevelListScene:ctor()
    local bg = display.newSprite("img/map/tollgate.jpg", display.cx, display.cy)
    self:addChild(bg)

    local label = ui.newTTFLabelMenuItem({
        text = '返回',
        listener = on_clicked,
        color = cc.c3(0, 0, 0)
    })
    label:setAnchorPoint(cc.p(1, 1))

    local menu = ui.newMenu({label})
    menu:alignItemsVertically()
    -- menu:setPosition(display.cx, display.cy)
    menu:setPosition(display.width, display.height)

    self:addChild(menu)

    local tollgate_path = CCFileUtils:sharedFileUtils():fullPathForFilename("csv/Tollgate.csv")
    local data = XUtil.parse_csv(tollgate_path, 3)
    XUtil.var_dump(data)
end

function LevelListScene:onEnter()
end

function LevelListScene:onExit()
end

return LevelListScene